how to calculate discrete fourier transform